Computing systems and other devices utilizing processing devices operate based on machine code that is specific to the particular hardware platform of the computing system or processor. “Native code” is a term generally referring to the code that runs on a specific hardware platform after it is compiled. With Java or other similar environments, the execution of the code via a virtual machine running on top of the hardware platform is generally slower than native code execution. This is generally due to the relatively slow nature of virtual machine interpretation, which refers to the instruction-by-instruction translation of the machine language (e.g., Java bytecodes) of the virtual machine. Interpretation methodologies are generally slow, as many native instructions may be necessary to simulate only one virtual machine instruction.
To address this issue in the context of virtual machines, a number of virtual machine implementation variants have been devised, such as Just-In-Time (JIT) compilers, Dynamic Adaptive Compilation (DAC), and variations of Ahead-Of-Time (AOT) compilation. These methods generally include some aspect of compilation of the machine language of the virtual machine, which allows native code to be executed versus the instruction-by-instruction interpretation that may each result in multiple native instructions. Certain portions of the program executed by the virtual machine may therefore be identified for compiling, while other portions are interpreted.
However, existing virtual machine implementations expend a significant amount of time determining which portions of the program are to be compiled versus interpreted. To exacerbate the problem, these programs may be executed again and again, resulting in repeated determinations of the which program segments should be interpreted, and which should be compiled. This analysis is time consuming, and adversely affects the overall execution speed of the program.
Accordingly, there is a need for an expedited virtual machine, and a method for expediting virtual machine execution where program hot spots are earmarked for compilation in an implementation employing both interpretation and compilation techniques. The present invention fulfills these and other needs, and offers other advantages over the prior art approaches.